<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/page/share/taglib.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>广告列表</title>
    <script type="text/javascript">
    	function deletead(id,filename){
    		if(confirm("确认要删除？")){
				location.href = "/control/ad/delete?ad.id=" + id + "&ad.filename=" + filename;
			}
    	}
    </script>
  </head>
  
  <body>
   		<table width="100%" align="center">
   			<tr><td><a href="/control/ad/add">添加广告</a></td></tr>
   			<tr>
   			  <th>编号</th>
   			  <th>文件名</th>
   			  <th>广告内容</th>
   			  <th>js调用路径</th>
   			  <th width="30%">操作</th>
   			</tr>
   			
   			<c:forEach items="${pageView.records}" var="entry">
   			<tr align="center">
   			  
   			  <td>${entry.id }</td>
   			  <td>${entry.filename }</td>
   			  <td><textarea style="width: 400px;height: 100px;">${entry.content }</textarea></td>
   			  <td><input type="text" value="<script src='${entry.filepath }'></script>"/></td>
   			  <td>
   			  <a href="/control/ad/edit?ad.id=${entry.id }">修改</a> 
   			  <a href="javascript:void(0)" onclick="deletead('${entry.id}','${entry.filename }')">删除</a>
   			  </td>
   			</tr>
   			</c:forEach>
   		</table>
  </body>
</html>